<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="dominio.Configuracion"%>
<%@page language="java" import="java.util.*"%>

<h1>Lista de Configuraciones</h1>
<form id="cambiarConfiguraciones" method="post" class="form-inline" role="form">
	<div class="table-responsive">
		<table class="table table-bordered table-striped">
			<thead>
				<tr>
					<th>Codigo de Modulo</th>
					<th>Tipo de Modulo</th>
					<th>IP</th>
					<th>Activa</th>
					<th>Sincronico</th>
				</tr>
			</thead>
			<tbody>
				<%
					List<Configuracion> data = (List<Configuracion>) request
							.getAttribute("data");
					for (Iterator<Configuracion> itr = data.iterator(); itr.hasNext();) {
						Configuracion configuracion = itr.next();
				%>
				<tr>
					<td><span><%=configuracion.getModuleId()%></span></td>
					<td><span><%=configuracion.getModuleType().toString()%></span></td>
					<td><span><%=configuracion.getTerminal()%></span></td>
					<td><input name="activa" type="checkbox" value="<%=configuracion.getModuleId() %>"
						<%if (configuracion.esActiva()) {%> checked="checked"> <%}%>
					</td>
					<td><input name="sincronica" type="checkbox" value="<%=configuracion.getModuleId() %>"
						<%if (configuracion.esSincronico()) {%> checked="checked"><%}
						%></td>
				</tr>
				<%
					}
				%>
			</tbody>
		</table>
	</div>
	<div class="form-group">
		<div class="col-sm-2 control-label">
			<div class="col-sm-10">
				<button type="submit" class="btn btn-success">Guardar</button>
			</div>
		</div>
	</div>
</form>
<script type="text/javascript" src="js/tpia.js"></script>